Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RCL Implementation #596

Merged
merged 1 commit into from
Nov 6, 2023
Merged

Fix RCL Implementation #596

merged 1 commit into from
Nov 6, 2023

Conversation

enusbaum
Copy link
Member

@enusbaum enusbaum commented Nov 5, 2023

  • Fixes RCL Implementation to be accurate
  • Added Unit tests for both 8-bit and 16-bit RCL operations
  • Minor code cleanup

- Fixes RCL Implementation to be accurate
- Added Unit tests for both 8-bit and 16-bit RCL operations
- Minor code cleanup
@enusbaum enusbaum requested a review from paladine November 5, 2023 19:14
if (Registers.CarryFlag)
result.SetFlag(1);
result |= 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this equivalent?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, technically .SetFlag is an extension method we have on byte types, which since they're static, can't modify the underlying instance value. This was one of the bugs with the underlying logic here, because if using the helper method it should be result = result.SetFlag(1), which I felt was overhead for just a |= 1 operation.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, subtle

@paladine paladine merged commit e0cec17 into master Nov 6, 2023
1 check passed
@paladine paladine deleted the rcl-fixes branch November 6, 2023 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants